import rxAjax from '@/assets/js/ajax.js';

//流程实例权限表 api接口
export const BpmInstPermissionApi = {};

BpmInstPermissionApi.baseUrl= '/api-bpm/bpm/core/bpmInstPermission';
BpmInstPermissionApi.exportUrl= BpmInstPermissionApi.baseUrl + '/listExport';

//保存数据
BpmInstPermissionApi.savePermission =function(parameter) {
  var url= BpmInstPermissionApi.baseUrl + '/savePermission';
  return rxAjax.postJson(url,parameter);
}

//保存数据
BpmInstPermissionApi.savePermissionGroup =function(parameter) {
  var url= BpmInstPermissionApi.baseUrl + '/savePermissionGroup';
  return rxAjax.postJson(url,parameter);
}

//删除数据
BpmInstPermissionApi.delPermission =function(parameter) {
  var url = BpmInstPermissionApi.baseUrl + '/delPermission';
  return rxAjax.postJson(url, parameter);
}

//查询列表
BpmInstPermissionApi.query=function (parameter) {
  var url= BpmInstPermissionApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

/**
* 获取单记录
* @param pkId
* @returns {*}
*/
BpmInstPermissionApi.get =function(pkId) {
  var url= BpmInstPermissionApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
BpmInstPermissionApi.save =function(parameter) {
  var url= BpmInstPermissionApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
BpmInstPermissionApi.del =function(parameter) {
  var url= BpmInstPermissionApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

export  default BpmInstPermissionApi;

